package com.atxiao.demo.service;

import com.atxiao.demo.bean.User;
import com.atxiao.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    public UserMapper mapper;

    @Override
    public User getUser(String phone, String password) {
        User user = mapper.getUser(phone, password);
        return user;
    }

    @Override
    public User getUserByPhone(String name) {
        User user = mapper.getUserByPhone(name);
        return user;
    }

    @Override
    public String getUserNameByPassword(String password) {
        String result = mapper.getUserNameByPassword(password);
        return result;
    }

    @Override
    public boolean registerUser(String name, String password,String phone) {
        boolean flag = mapper.registerUser(name, password,phone);
        return flag;
    }

    @Override
    public void changeStatus(int status, String name,String time) {
        mapper.changeStatus(status,name,time);
    }
}
